home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mem / MPW Helpers / Scripts / MarkIcon < prev    next >
Encoding:
Text File  |  1992-10-03  |  1.3 KB  |  87 lines  |  [TEXT/MPS ]

  1. #
  2. #  MPW Shell script to create MPW marks for all procedures,
  3. #  records, global and link statements.
  4. #
  5.  
  6. #
  7. #  Set up.
  8. #
  9. set Exit 0
  10. if "{1}" == "-y"
  11.   set y 1
  12.   shift
  13. else
  14.   set y 0
  15. end
  16. if {#} == 0
  17.   set 1 "{Target}"
  18. end
  19. open "{1}"
  20. if {Status}
  21.   alert "Can∂'t find ∂"{1}∂"."
  22.   exit
  23. end
  24. #
  25. #  Delete existing markers, with his permission.
  26. #
  27.   set marks "`markers "{1}"`"
  28.   if {y}
  29.     unmark {marks} "{1}"
  30.   else
  31.     if "{marks}" != ""
  32.       confirm -t "Delete existing marks?"
  33.       exit if {Status} == 5
  34.       if {Status} == 0
  35.     unmark {marks} "{1}"
  36.       end
  37.     end
  38.   end
  39. #
  40. #  Mark procedures.
  41. #
  42. find • "{1}"
  43. loop
  44.   find /•[ ∂t]*procedure[ ∂t]+/ "{1}"
  45.   break if {Status}
  46.   find /[a-zA-Z0-9_]+/ "{1}"
  47.   mark § "`catenate "{1}.§"`" "{1}"
  48. end
  49. #
  50. #  Mark records.
  51. #
  52. find • "{1}"
  53. loop
  54.   find /•[ ∂t]*record[ ∂t]+/ "{1}"
  55.   break if {Status}
  56.   find /[a-zA-Z0-9_]+/ "{1}"
  57.   mark § "`catenate "{1}.§"`" "{1}"
  58. end
  59. #
  60. #  Mark globals.
  61. #
  62. set count ''
  63. find • "{1}"
  64. loop
  65.   find /•[ ∂t]*global[ ∂t]+/ "{1}"
  66.   break if {Status}
  67.   find Δ§:/global/ "{1}"
  68.   mark § "global {count}" "{1}"
  69.   evaluate count += 1
  70. end
  71. #
  72. #  Mark links.
  73. #
  74. set count ''
  75. find • "{1}"
  76. loop
  77.   find /•[ ∂t]*link[ ∂t]+/ "{1}"
  78.   break if {Status}
  79.   find Δ§:/link/ "{1}"
  80.   mark § "link {count}" "{1}"
  81.   evaluate count += 1
  82. end
  83. #
  84. #  All done -- position at start of file.
  85. #
  86. find • "{1}"
  87.